package com.qianyucc.blog.exception;

import com.qianyucc.blog.model.enums.*;
import lombok.*;

/**
 * @author lijing
 * @date 2019-10-12 10:25
 * @description api异常的超类
 */
@Data
public class BaseException extends RuntimeException {
    // 错误码
    protected Long code;

    public BaseException(RespCode respCode) {
        super(respCode.getMessage());
        this.code = respCode.getCode();
    }

    public BaseException(RespCode respCode, String message) {
        super(message);
        this.code = respCode.getCode();
    }
}